package cn.blossoming.service.base.exception;

public class BaseException extends RuntimeException {

    /** code 说明
     * 100 短信发送失败
     * 101 非法手机号
     * 102 发送短信账户余额不足
     * 103 验证码错误
     * 420 你已经赞过了
     *
     *
     *
     *
     */

    private int code = -1;

    public BaseException(String message) {
        super(message);
    }

    public BaseException(int code, String message) {
        super(message);
        this.code = code;
    }

    public BaseException(int code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }

    public BaseException(int code, String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
